class Solution(object):
    def getDescentPeriods(self, prices):
        n = len(prices)
        left = 0
        right = 1
        ans = 1
        while right < n:
            if prices[right] == prices[right - 1] - 1:
                ans += right - left + 1
            else:
                ans += 1
                left =right
            right += 1
        return ans

